#include "card.h"


Card::Card(CardPoint point, CardSuit suit)
{
    setPoint(point);
    setSuit(suit);
}


void Card::setPoint(Card::CardPoint point)
{
    this->m_point = point;
}

void Card::setSuit(Card::CardSuit suit)
{
    this->m_suit = suit;
}

Card::CardPoint Card::Point() const
{
    return m_point;
}

Card::CardSuit Card::Suit() const
{
    return m_suit;
}

Card::Card()
{

}



bool lessSort(const Card &c1, const Card &c2)
{
    if(c1.Point() == c2.Point())
    {
        return c1.Suit() < c2.Suit();
    } else {
        return c1.Point() <  c2.Point();
    }
}

bool greateSort(const Card &c1, const Card &c2)
{
    if(c1.Point() == c2.Point())
    {
        return c1.Suit() > c2.Suit();
    } else {
        return c1.Point() >  c2.Point();
    }
}

bool operator==(const Card &left, const Card &right)
{
     return (left.Suit() == right.Suit() && (left.Point() == right.Point()));
}

uint qHash(const Card &card)
{
    return card.Point() * 100 + card.Suit();
}
